import { Component, OnInit, ViewChild } from '@angular/core';
import { formatSize, UploadComponent, UploadStatusEnum, UploadFileStatusEnum} from '@iux/live';

@Component({
  selector: 'app-demo2',
  templateUrl: './demo2.component.html',
  styles: []
})
export class Demo2Component implements OnInit {
  @ViewChild(UploadComponent, { static: true}) lvUpload: UploadComponent;

  files;
  constructor() { }

  ngOnInit() {
    this.files = [{
      key: '-1',
      name: 'xxx.png',
      size: 10000,
      fileSize: formatSize(10000),
      status: UploadFileStatusEnum.SUCCESS
    }];

    this.lvUpload.setUploadStatus(UploadStatusEnum.COMPLETE);
  }
  
  change(e) {
    console.log(e);
  }
}
